CC = gcc
LD = gcc
#CFLAGS = -g -Wall -std=c99 -fPIC -I../src
CFLAGS = -O3 -Wall -std=c99 -fPIC -DNDEBUG -I../src
LDFLAGS = -L../src -Wl,-rpath=../src -levent_helper -levent_core

all: echo_server chat_server echo_client filter_test

echo_server: echo_server.o
	$(LD) $^ $(LDFLAGS) -o $@

chat_server: chat_server.o
	$(LD) $^ $(LDFLAGS) -o $@

echo_client: echo_client.o
	$(LD) $^ $(LDFLAGS) -o $@

filter_test: filter_test.o
	$(LD) $^ $(LDFLAGS) -o $@

echo_server.o: echo_server.c
chat_server.o: chat_server.c
echo_client.o: echo_client.c
filter_test.o: filter_test.c

clean:
	$(RM) *.o
	$(RM) echo_server
	$(RM) chat_server
	$(RM) echo_client
	$(RM) filter_test

.PHONY: all clean
